home *** CD-ROM | disk | FTP | other *** search
- PAGE 60,132
-
- ; SHOWCAPS.ASM
-
-
- CSEG SEGMENT
- ASSUME CS:CSEG
- ORG 100H
-
- START PROC NEAR
- JMP MAKERES
-
- OLD_INT8 DD ? ; Save old INT 8 -- timer
-
- SHOWCAPS:
- PUSH AX ; Save registers to be used
- PUSH CX
- PUSH DS
-
- CLI ; Disable interrupts
- MOV AH,2 ; Get current keyboard status
- INT 16H ; Keyboard I/O
-
- AND AL,40H ; Has Caps Lock been toggled to upper case?
- JNZ UC ; If so then set cursor big
- LC: ; Else set cursor small
- INT 11H ; Get equipment
-
- AND AX,30H ; Is the CRT monochrome?
- ; CMP AX,30H ; Is the CRT monochrome?
- JE LC_MONO
- LC_COLOR:
- MOV CX,0607H ; Set cursor for lower case color
- JMP DO_IT
- LC_MONO:
- MOV CX,0B0CH ; Set cursor for lower case monochrome
- JMP DO_IT
- UC:
- INT 11H ; Get equipment
-
- AND AX,30H
- CMP AX,30H ; Is the CRT monochrome?
- JE UC_MONO
- UC_COLOR:
- MOV CX,0007H ; Set cursor for upper case color
- JMP DO_IT
- UC_MONO:
- MOV CX,010BH ; Set cursor for upper case monochrome
- DO_IT:
- MOV AH,1 ; Set cursor
- INT 10H
- DONE:
- STI ; Enable interrupts again
- POP DS
- POP CX
- POP AX
-
- JMP CS:[OLD_INT8] ; Continue with normal timer interrupt
- ENDRES:
-
- MAKERES:
- PUSH CS
- POP DS
- ASSUME DS:CSEG
-
- MOV AX,3508H ; Get vector for timer
- INT 21H ; interrupt function
-
- MOV WORD PTR [OLD_INT8],BX ; Keep old pointers
- MOV WORD PTR [OLD_INT8+2],ES
-
- MOV AX,2508H ; Set vector 8 to
- MOV DX,OFFSET SHOWCAPS ; point to SHOWCAPS
- INT 21H
-
- MOV DX,OFFSET ENDRES
- MOV CL,4 ; Calculate size of code
- SHR DX,CL ; to be resident
- INC DX
- MOV AX,3100H ; Make the function stay resident
- INT 21H
-
- START ENDP
- CSEG ENDS
- END START